<html>
   <head>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="">
<h2 class="comptitle">Msg File <i>base/messages/ChannelSenseRequest.msg</i></h2>
<table class="typetable">
   <tr>
      <th>Name</th>
      <th>Description</th>
   </tr>
<tr>
   <td>
      <a href="SenseMode.html">SenseMode</a>
      <i> (enum)</i>
   </td>
   <td>
<i>(no description)</i>
   </td>
</tr>
<tr>
   <td>
      <a href="ChannelSenseRequest.html">ChannelSenseRequest</a>
      <i> (packet)</i>
   </td>
   <td>

<p>The <a href="ChannelSenseRequest.html">ChannelSenseRequest</a> is a control packet from the
MAC layer to the physical layer. In contrast to the
"getChannelState()" method of the MacToPhyInterface
which imediatly returns the current ChannelState
the <a href="ChannelSenseRequest.html">ChannelSenseRequest</a> tells the physical layers decider
to sense over a period of time before sending back
the request together with the ChannelState over this period.</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #000000; ">
</span><span style="color: #800000; font-weight: bold; ">cplusplus</span><span style="color: #000000; "> {{
#</span><span style="color: #000000; ">include</span><span style="color: #000000; "> </span><span style="color: #008000; ">&quot;ChannelState.h&quot;</span><span style="color: #000000; ">
}}




</span><span style="color: #800000; font-weight: bold; ">class</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">noncobject</span><span style="color: #000000; "> </span><span style="color: #000000; ">ChannelState</span><span style="color: #000000; ">;

</span><span style="color: #800000; font-weight: bold; ">enum</span><span style="color: #000000; "> </span><span style="color: #000000; ">SenseMode</span><span style="color: #000000; "> {
    </span><span style="color: #000000; ">UNTIL_IDLE</span><span style="color: #000000; "> = </span><span style="color: #008000; ">1</span><span style="color: #000000; ">;		</span><span style="color: #808080; font-style: italic; ">//sense until channel is busy or timeout is reached
</span><span style="color: #000000; ">    </span><span style="color: #000000; ">UNTIL_BUSY</span><span style="color: #000000; "> = </span><span style="color: #008000; ">2</span><span style="color: #000000; ">;		</span><span style="color: #808080; font-style: italic; ">//sense until channel is idle or timeout is reached
</span><span style="color: #000000; ">    </span><span style="color: #000000; ">UNTIL_TIMEOUT</span><span style="color: #000000; "> = </span><span style="color: #008000; ">3</span><span style="color: #000000; ">;	</span><span style="color: #808080; font-style: italic; ">//sense until timeout is reached
</span><span style="color: #000000; ">};
    
</span><span style="color: #808080; font-style: italic; ">//
// The ChannelSenseRequest is a control packet from the
// MAC layer to the physical layer. In contrast to the
// &quot;getChannelState()&quot; method of the MacToPhyInterface
// which imediatly returns the current ChannelState
// the ChannelSenseRequest tells the physical layers decider
// to sense over a period of time before sending back
// the request together with the ChannelState over this period.
//
// Every ChannelSenseRequest sent to the physical layer
// has to define a SenseMode and a timeout.
// The timeout defines after how much seconds the request
// should be sent back to the MAC layer at latest.
// The SenseMode tells the physical layers the purpose of the
// sense. The SenseModes &quot;UNTIL_IDLE&quot; and &quot;UNTIL_BUSY&quot; are
// telling it to inform the MAC layer as soon as the 
// channel turns idle/busy by sending the request back to it.
// If the channel state does not change the request is sent
// back after the timeout.
// While &quot;UNTIL_IDLE&quot; and &quot;UNTIL_BUSY&quot; can be used as pure
// conveniance functions which don't necessarily represent a
// real channel sense, &quot;UNTIL_TIMEOUT&quot; *always* represents a real 
// channel sensing of the MAC over a fixed period of time
// where the request together with the result will be always sent 
// back after the timeout.
//
// The request returned to the MAC layer holds the result
// in the form of a ChannelState object. How the idle and
// rssi info contained in the ChannelState are calculated
// and interpreted depends on the Decider.
//
</span><span style="color: #800000; font-weight: bold; ">packet</span><span style="color: #000000; "> </span><span style="color: #000000; ">ChannelSenseRequest</span><span style="color: #000000; ">
{
    </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">senseMode</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">enum</span><span style="color: #000000; ">(</span><span style="color: #000000; ">SenseMode</span><span style="color: #000000; ">);	</span><span style="color: #808080; font-style: italic; ">// defines the sensing mode (see SenseMode enum)
</span><span style="color: #000000; ">    </span><span style="color: #000000; ">simtime_t</span><span style="color: #000000; "> </span><span style="color: #000000; ">senseTimeout</span><span style="color: #000000; ">; 		</span><span style="color: #808080; font-style: italic; ">// Time to listen on the channel
</span><span style="color: #000000; ">    </span><span style="color: #000000; ">ChannelState</span><span style="color: #000000; "> </span><span style="color: #000000; ">result</span><span style="color: #000000; ">; 			</span><span style="color: #808080; font-style: italic; ">// The result of the request containing the current state of the channel.
</span><span style="color: #000000; ">									</span><span style="color: #808080; font-style: italic; ">// See ChannelState for details.
</span><span style="color: #000000; ">}
</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
